# Copyright (c) 2020 cgsdfc
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT

load("@pybind11_bazel//:build_defs.bzl", "pybind_library", "pybind_library_test")
load("//bazel:generate_source.bzl", "generate_source")

licenses(["notice"])

package(default_visibility = ["//visibility:public"])

generate_source(
    name = "ast_h",
    output = "ast.h",
)

generate_source(
    name = "undefs_h",
    output = "undefs.h",
)

generate_source(
    name = "ast_cc",
    output = "ast.cc",
)

generate_source(
    name = "config_h",
    output = "config.h",
)

pybind_library(
    name = "pyast",
    srcs = [
        "arena.h",
        "asdl_seq.h",
        "ast.cc",
        "ast.h",
        "ast_node.h",
        "config.h",
        "location.h",
        "logging.h",
        "pyast.h",
        "pybind_defs.h",
        "undefs.h",
    ],
)

pybind_library_test(
    name = "pyast_test",
    srcs = [
        "arena_test.cc",
        "asdl_seq_test.cc",
        "ast_node_test.cc",
    ],
    deps = [
        ":pyast",
        # "@pybind11//:pybind11_embed",
    ],
)
